home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00982_Gestion de la Barrette.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  5.9 KB  |  151 lines

  1. on SetDcBarrette AccuA
  2.   global DcBarrette
  3.   set DcBarrette to AccuA
  4. end
  5.  
  6. on InitBarrette AccuA
  7.   global DcBarrette, TypeBarrette, SprFondBar, CastBarrette
  8.   SetDcQuit(0)
  9.   set DcBarrette to 1
  10.   if length(AccuA) <> 3 then
  11.     set AccuA to chars(AccuA, 5, 7)
  12.   end if
  13.   set TypeBarrette to "0010110101000" & AccuA
  14.   puppetSprite(SprFondBar, 1)
  15.   set the castNum of sprite SprFondBar to CastBarrette
  16.   InitCastRollEff()
  17.   BalayBarrette()
  18.   InitFlecheDemo()
  19. end
  20.  
  21. on ClicBoutBar
  22.   global ColCastBar, ChampsBarrette
  23.   if (ColCastBar < 0) or (ColCastBar > 16) then
  24.     exit
  25.   end if
  26.   CallM(getAt(ChampsBarrette, ColCastBar + 1))
  27. end
  28.  
  29. on BalayBarrette
  30.   global SprFondBar, ColCastBar, ChampsBarrette, DcCursMain, CastEfface, SprBoutBar
  31.   if rollOver(SprFondBar) then
  32.     set ColonnePointe to the mouseH / 40
  33.     if ColCastBar <> ColonnePointe then
  34.       set ColCastBar to ColonnePointe
  35.       set the castNum of sprite SprBoutBar to getAt(ChampsBarrette, ColonnePointe + 33)
  36.       set the locH of sprite SprBoutBar to getAt(ChampsBarrette, ColonnePointe + 49)
  37.     end if
  38.     set DcCursMain to getAt(ChampsBarrette, ColonnePointe + 65)
  39.     return SetAffTxtRoll(getAt(ChampsBarrette, ColonnePointe + 17))
  40.   end if
  41.   if ColCastBar <> 99 then
  42.     set the castNum of sprite SprBoutBar to CastEfface
  43.     set ColCastBar to 99
  44.   end if
  45. end
  46.  
  47. on InitCastRollEff
  48.   global NameExt, TypeBarrette, ChampsBarrette, listBarrette010, listBarrette011, listBarrette110, listBarrette111, listBarretteNav, MemoNavPuce, CastRollEff, CastBarrette, SprFondBar, SprFondBarII, SprRollOver, CastFondTextRoll, DcDemoRec, CastEfface, ColCastBar, NcRollBarrette
  49.   if the movieName <> "NAVIG" then
  50.     set NomFinBar to chars(TypeBarrette, 14, 16)
  51.     set NomCastBarII to "FNDBA" & NomFinBar
  52.     if NomFinBar = "010" then
  53.       set ChampsBarrette to listBarrette010
  54.     end if
  55.     if NomFinBar = "011" then
  56.       set ChampsBarrette to listBarrette011
  57.     end if
  58.     if NomFinBar = "110" then
  59.       set ChampsBarrette to listBarrette110
  60.     end if
  61.     if NomFinBar = "111" then
  62.       set ChampsBarrette to listBarrette111
  63.     end if
  64.   else
  65.     if word 1 of MemoNavPuce = "DEPART" then
  66.       set NomCastBarII to "FNDBADEP"
  67.       set TypeBarrette to "0010110100010010"
  68.     else
  69.       set NomCastBarII to "FNDBANAV"
  70.       set TypeBarrette to "0010110101010010"
  71.     end if
  72.     set Champs to list("Nothing", "Nothing", "Logo", "Nothing", "SonMoins", "SonPlus", "Nothing", "Quitter", "Nothing", "RetourNavig", "Nothing", "Aide", "Nothing", "Nothing", "LanceDemo", "Nothing")
  73.     set ChampsBarrette to SetChampsBarrette(Champs)
  74.   end if
  75.   if the castNum of sprite SprFondBar = CastBarrette then
  76.     puppetSprite(SprFondBarII, 1)
  77.     set the castNum of sprite SprFondBarII to the number of cast NomCastBarII
  78.     set the locV of sprite SprFondBarII to 460
  79.     set the locH of sprite SprFondBarII to 582
  80.     puppetSprite(SprRollOver, 1)
  81.     set the visible of sprite SprRollOver to 1
  82.     set the locV of sprite SprRollOver to 441
  83.     set the locH of sprite SprRollOver to 246
  84.     RestoreBoutBar()
  85.     if RecupToutConsulte() = 0 then
  86.       set CastRollEff to CastFondTextRoll
  87.     else
  88.       set CastRollEff to the number of cast "R_ToutConsulte"
  89.     end if
  90.     if DcDemoRec = 1 then
  91.       set CastRollEff to the number of cast "R_DemoRec"
  92.     end if
  93.   else
  94.     set CastRollEff to CastEfface
  95.     set ColCastBar to 99
  96.     set NcRollBarrette to 2
  97.   end if
  98.   RestoreCursor()
  99. end
  100.  
  101. on RestoreBoutBar
  102.   global SprBoutBar, CastEfface, NcRollBarrette, ColCastBar
  103.   puppetSprite(SprBoutBar, 1)
  104.   set the visible of sprite SprBoutBar to 1
  105.   set the ink of sprite SprBoutBar to 36
  106.   set the castNum of sprite SprBoutBar to CastEfface
  107.   set the locV of sprite SprBoutBar to 460
  108.   set the locH of sprite SprBoutBar to 0
  109.   set ColCastBar to 99
  110.   set NcRollBarrette to 2
  111. end
  112.  
  113. on InitVarBarrette
  114.   global CastBarrette, CastBoutBar, CastFondTextRoll, CastTextDemoRoll, CastPatientez, SprFondBar, SprFondBarII, SprBoutBar, SprRollOver, TypeBarrette, listBarrette010, listBarrette011, listBarrette110, listBarrette111, listBarretteNav
  115.   set CastBarrette to the number of cast "N_Barrette"
  116.   set CastBoutBar to the number of cast "N_CastRollbar"
  117.   set CastFondTextRoll to the number of cast "FondTexteRoll"
  118.   set CastTextDemoRoll to the number of cast "R_DemoEnCours"
  119.   set CastPatientez to the number of cast "R_Patientez"
  120.   set SprFondBar to 43
  121.   set SprRollOver to 44
  122.   set SprFondBarII to 45
  123.   set SprBoutBar to 46
  124.   set Champs to list("Nothing", "Nothing", "Logo", "Nothing", "SonMoins", "SonPlus", "Nothing", "Quitter", "Nothing", "Fusee", "Nothing", "Nothing", "Nothing", "Retour", "SautDePuce", "Suite")
  125.   set TypeBarrette to "0010110101000011"
  126.   set listBarrette011 to SetChampsBarrette(Champs)
  127.   set TypeBarrette to "0010110101000110"
  128.   set listBarrette110 to SetChampsBarrette(Champs)
  129.   set TypeBarrette to "0010110101000111"
  130.   set listBarrette111 to SetChampsBarrette(Champs)
  131.   set TypeBarrette to "0010110101000010"
  132.   set listBarrette010 to SetChampsBarrette(Champs)
  133.   set listBarretteNav to list()
  134. end
  135.  
  136. on SetChampsBarrette Champs
  137.   global TypeBarrette, CastBoutBar, CastEfface
  138.   set CastTextFondRoll to the number of cast "FondTexteRoll"
  139.   set ChampsBarrette to list(EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, EMPTY, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 80, 120, 160, 200, 240, 280, 320, 360, 400, 440, 480, 520, 560, 600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  140.   repeat with AccuA = 1 to 16
  141.     set Oper to value(char AccuA of TypeBarrette)
  142.     setAt(ChampsBarrette, AccuA, getAt(Champs, AccuA))
  143.     set AccuB to (the number of cast ("R_" & getAt(Champs, AccuA)) * Oper) + (CastTextFondRoll * (Oper = 0))
  144.     setAt(ChampsBarrette, AccuA + 16, AccuB)
  145.     set AccuC to (CastBoutBar * Oper) + (CastEfface * (Oper = 0))
  146.     setAt(ChampsBarrette, AccuA + 32, AccuC)
  147.     setAt(ChampsBarrette, AccuA + 64, Oper)
  148.   end repeat
  149.   return ChampsBarrette
  150. end
  151.